#include <iostream>
#include <stack>
using namespace std;

class MyQueue {
public:
    /** Initialize your data structure here. */
    MyQueue() {
        
    }
    
    /** Push element x to the back of queue. */
    void push(int x) {
        while (!st1.empty()) {
            st2.push(st1.top());
            st1.pop();
        }
        st1.push(x);
        while (!st2.empty()) {
            st1.push(st2.top());
            st2.pop();
        }
    }
    
    /** Removes the element from in front of queue and returns that element. */
    int pop() {
        int frontElement = st1.top();
        st1.pop();
        return frontElement;
    }
    
    /** Get the front element. */
    int peek() {
        return st1.top();
    }
    
    /** Returns whether the queue is empty. */
    bool empty() {
        return st1.empty();
    }

private:
    stack<int> st1, st2;
};

int main() {
    MyQueue q;
    
    q.push(1);
    q.push(2);
    q.push(3);

    cout << "Front element: " << q.peek() << endl;
    
    q.pop();

    cout << "Front element after pop: " << q.peek() << endl;

    return 0;
}